<template>
    <div style="width:85%; margin: 20px auto">
        <el-container>
            <el-header>Header</el-header>
            <el-container>
                <el-aside width="200px">
                    <!-- 侧面导航栏 -->
                    <el-col :span="12" style="width:100%;">
        
                        <el-menu router
                        default-active="2"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose">
                        <el-submenu index="/manage">
                            <template slot="title">
                            <i class="el-icon-location"></i>
                            <span>首页</span>
                            </template>
                            
                            
                        </el-submenu>
                        <el-submenu index="manage">
                            <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>分类管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="/manage/add_cate">添加分类</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        
                        <el-menu-item index="3" disabled>
                            <i class="el-icon-document"></i>
                            <span slot="title">导航三</span>
                        </el-menu-item>
                        <el-menu-item index="4">
                            <i class="el-icon-setting"></i>
                            <span slot="title">导航四</span>
                        </el-menu-item>
                        </el-menu>
                    </el-col>
                    <!-- 导航结束 -->
                </el-aside>
                <el-main>
                    <!-- 在这里陪主路由，然后去index.js中配子路由 -->
                    <router-view/>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
export default {
    data() {
        return {
            
        }
    },
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
    },
    created() {
        
    },
}
</script>


<style>
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 500px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>